import request from '@/utils/request'
// 列表
export function GetListAPI(params) {
  return request({
    url: '/order/subcontracting-order/list',
    method: 'GET',
    params
  })
}

// 新增
export function AddDataAPI(data) {
  return request({
    url: '/order/subcontracting-order/add',
    method: 'POST',
    data
  })
}

// 修改
export function EditDataAPI(data) {
  return request({
    url: '/order/subcontracting-order/update',
    method: 'POST',
    data
  })
}

// 删除
export function DelDataAPI(data) {
  return request({
    url: '/order/subcontracting-order/delete/' + data,
    method: 'delete'
  })
}

// 删除
export function DelDatasAPI(params) {
  return request({
    url: '/order/subcontracting-order/deleteSubcontractingOrder/' + params,
    method: 'DELETE'
  })
}

// 查看详情
export function GetDetailAPI(data) {
  return request({
    url: '/order/subcontracting-order/getView/' + data,
    method: 'GET'
  })
}

// 关结
export function CloseAPI(data) {
  return request({
    url: '/order/subcontracting-order/close',
    method: 'POST',
    data
  })
}

// 撤销审核
export function RevokeAPI(data) {
  return request({
    url: '/order/subcontracting-order/deleteReview/' + data,
    method: 'GET'
  })
}

// 提交审核
export function ReviewSubmitAPI(data) {
  return request({
    url: '/order/subcontracting-order/submitReview',
    method: 'POST',
    data
  })
}

// 上传合同
export function UploadContractAPI(data) {
  return request({
    url: '/order/subcontracting-order/uploadContract',
    method: 'POST',
    data
  })
}

// 单据明细查询
export function GetViewAPI(data) {
  return request({
    url: '/order/subcontracting-order-detail/getView/' + data.id,
    method: 'GET',
    params: data
  })
}

// 委外订单物料明细列表
export function GetDetailListAPI(data) {
  return request({
    url: '/order/subcontracting-order-material-detail/list/' + data.id,
    method: 'GET',
    params: data
  })
}

// 订单审核
export function ToExamineAPI(data) {
  return request({
    url: '/order/subcontracting-order/orderReview',
    method: 'POST',
    data
  })
}

// 合同审核
export function ContractExamineAPI(data) {
  return request({
    url: '/order/subcontracting-order/contractReview',
    method: 'POST',
    data
  })
}

// 计划查询-关联单号
export function productionPlanListAPI(params) {
  return request({
    url: '/scheduling/productionPlan/getListByStatus',
    method: 'GET',
    params
  })
}
